home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: watzka@stat.uni-muenchen.de (Kurt Watzka)
- Newsgroups: comp.lang.c
- Subject: Re: strange behaviour of doubles
- Date: 4 Mar 1996 12:11:07 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4hemkr$shd@sparcserver.lrz-muenchen.de>
- References: <1996Mar4.014052.6236@dcs.warwick.ac.uk>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero) writes:
-
-
- >#include <stdio.h>
- >#include <stdlib.h>
-
- >main() {
- >double x, y;
- >scanf("%g", &x);
- >while (x != 0.0) {
- > scanf("%g", &y);
- > printf("%g %g\n", x, y);
- > scanf("%g", &x);
- >}
- >return(0);
- >}
-
- Unfortunately, there is some lack of symmetry between printf() and
- scanf(). If you want to read doubles, use "%lf" etc.
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-
-